#!/usr/bin/env python
from configs import config
import logging
from programinfo import info

logger = logging.getLogger(info["name"])

# Add file handler to save to log file
fh = logging.FileHandler(config["LOGFILE"])
formatter = logging.Formatter("%(asctime)s %(levelname)s %(message)s")
fh.setFormatter(formatter)
logger.addHandler(fh)

# Add stream handler for stdout/stderr
ch = logging.StreamHandler()
formatter = logging.Formatter("%(levelname)s %(message)s")
ch.setFormatter(formatter)
logger.addHandler(ch)

# Set default log level
logger.setLevel(logging.INFO)

